<template>
	<view>
		<view>账 号<input v-model="username"></view>
		<view>密 码<input v-model="password"></view>
		<view>电 话<input v-model="tel"></view>
		<view>昵 称<input v-model="nickname"></view>
		<button @tap="zc">注册</button>
	</view>
</template>

<script>
	import {register} from "../../../util/user/user.js"
	export default {
		data() {
			return {
				list:[],
				username:'',
				password:'',
				tel:'',
				nickname:'',
			}
		},
		methods: {
			zc(){
				register({
					username:this.username,
					password:this.password,
					tel:'18568185602',
					nickname:this.nickname,
					avatar:'https://bufan-cloud.oss-cn-beijing.aliyuncs.com/leju_test/20191212151304.jpg',
				})
				.then(res=>{
					console.log(res)
					var obj={
						username:this.username,
						password:this.password,
						tel:this.tel,
						nickname:this.nickname,
						avatar:'https://bufan-cloud.oss-cn-beijing.aliyuncs.com/leju_test/20191212151304.jpg',
					}
					uni.setStorageSync('obj',obj)
					uni.navigateTo({
						url: `/pages/user/login/login?username=${this.username} &password=${this.password}`,
					})
				})
			}
			
		}
		
	}
</script>

<style>

</style>
